# # while
# a = 10
# while a>0:
#     print(a)   #  10~1
#     a-=1



# # 计算1-100的值
# a = 1
# sum = 0
# while a<=100:
#     sum+=a
#     a+=1
# print(sum)   # sum = 5050


# #  计算 1-5的阶乘
# a = 1
# sum = 1
# while a <= 5:
#     sum *= a
#     a += 1
# print(f'sum = {sum}')    # sum = 120

# 计算1-5的阶乘之和
a = 1
sum = 0
while a <= 5:
    b = 1
    account = 1   # 要放在这里，才不会被重复使用
    while b <= a:
        account *= b
        b += 1
    a += 1
    sum += account
print(f'sum = {sum}')